package com;

import org.mybatis.spring.annotation.MapperScan;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.core.env.ConfigurableEnvironment;

@SpringBootApplication
@MapperScan("com.cc.spring.mapper")
public class MainApplication {
    private static Logger LOG = LoggerFactory.getLogger(MainApplication.class);
    public static void main(String[] args) {
//        SpringApplication.run(MainApplication.class, args);
        SpringApplication app = new SpringApplication(MainApplication.class);
//        获取配置文件
        ConfigurableEnvironment environment = app.run(args).getEnvironment();
        LOG.info("启动成功，访问路径：http://localhost:{}",environment.getProperty("server.port"));
    }
}
